<!DOCTYPE html>
<html lang="en">
<?php wp_head(); ?>
<?php
    $productCatId = 1;    
    function getCat($temp){
        $args = array(
            'type'                     => 'post',
            'child_of'                 => $productCatId,
            'parent'                   => $temp,
            'orderby'                  => 'name',
            'order'                    => 'ASC',
            'hide_empty'               => 0,
            'hierarchical'             => 0,
            'exclude'                  => '',
            'include'                  => '',
            'number'                   => '',
            'taxonomy'                 => 'category',
            'pad_counts'               => false );
        return get_categories( $args );

    }
?>
<head>
    <meta charset="UTF-8">
    <meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
    <title>
        <?php if(is_home()){
            bloginfo('name');echo " - ";bloginfo('description');
        } elseif ( is_category() ) {
            single_cat_title();echo " - ";bloginfo('name');
        } elseif (is_single() || is_page() ) {
            single_post_title();
        } elseif (is_search() ) {
            echo "搜索结果"; echo " - ";bloginfo('name');
        } elseif (is_404() ) {
            echo '页面未找到!';
        } else {
            wp_title('',true);
        } ?>
    </title>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/main.min.css">
</head>
<body>
    <div class="header">
        <h2 class="menu-icon"></h2>
        <h1 class="logo"><a href="i<?php echo get_option('home'); ?>/"></a></h1>
        <ul class="center nav cf">
            <span class="line"></span>
            <li class="first-nav nav-detail"><a href="<?php echo get_option('home'); ?>/">首页</a></li>
            <li class="nav-detail"><a href="aboutUs.html">关于我们</a></li> 
            <li class="nav-detail"><a href="latestNew.html">最新动态</a></li>
            <li class="nav-detail">
                <a href="javascript:void(0)" class="product-nav">产品中心</a>
                <div class="menu hide">
                    <ul class="menu-title cf">
                        <?php 
                            $catList = getCat($productCatId);
                            foreach($catList as $value){
                        ?>
                                <li>
                                    <a class="menu-link" href="javascript:void(0)"><?php echo $value->{name};?></a>
                                    <div class="menu-detail">
                                        <?php 
                                            $listDetail = getCat($value->{cat_ID});
                                            foreach($listDetail as $detail){
                                        ?>
                                                <a href="product.html"><?php echo $detail->{name};?></a>
                                        <?php }?>
                                    </div>
                                </li>
                        <?php }?>
                    </ul>
                    <span class="close-menu detail-nav"></span>
                    <div class="menu-footer"></div>
                </div>
            </li>
            <li class="nav-detail"><a href="beautyClass.html">美丽课堂</a></li>
            <li class="nav-detail"><a href="VIPcenter.html">会员中心</a></li>
            <li class="last-nav nav-detail"><a href="contactUs.html">联系我们</a></li>
            <span class="close-menu nav-close"></span>
        </ul>
    </div>
    <div class="blank80"></div>